<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		[v-cloak]{display: none;}
	</style>
</head>
<body>
<div v-cloak id="app">
	<h1>{{ msg }}</h1>
	<input type="text" v-model="msg">
	<br/>
	<input type="number" v-model="num1">
	<select v-model="option">
		<option v-for="option in options" :value="option">{{ option }}</option>
	</select>
	<input type="number" v-model="num2">
	<input type="button" @click="calc" value="=">
	<input type="text" v-model="result">
</div>
<script src="node_modules/vue/dist/vue.js"></script>
<script>
var vm = new Vue({
	el : '#app',
	data : {
		msg : 'hello',
		num1:0,
		num2:0,
		result:0,
		option:'+',
		options:['+', '-', '*', '/']
	},
	methods:{
		calc(){
			switch (this.option) {
				case '+':
					this.result = this.num1 - 0 + (this.num2 - 0)
					break;
				case '-':
					this.result = this.num1 - 0 - (this.num2 - 0)
					break;
				case '*':
					this.result = (this.num1 - 0) * (this.num2 - 0)
					break;
				case '/':
					this.result = (this.num1 - 0) / (this.num2 - 0)
					break;
			}
		}
	}
})
</script>
</body>
</html>